Skip to content

London | 25-SDC-Nov | Jesus del Moral | Sprint 1| Individual Shell Tools#204

Open
delmorallopez wants to merge 8 commits intoCodeYourFuture:mainfrom
delmorallopez:Individual-Shell-Tools
Open

London | 25-SDC-Nov | Jesus del Moral | Sprint 1| Individual Shell Tools#204
delmorallopez wants to merge 8 commits intoCodeYourFuture:mainfrom
delmorallopez:Individual-Shell-Tools

Conversation

@delmorallopez
Copy link

LONDON | 2025-NOV-SDC | Sprint1

Individual shell tools

@github-actions
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Wrong number of parts separated by |s

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

@delmorallopez delmorallopez added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 11, 2025
@github-actions
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Wrong number of parts separated by |s

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

@delmorallopez delmorallopez changed the title LONDON | 2025-NOV-SDC | Sprint1 | Individual shell tools LONDON | 2025-NOV-SDC | Sprint1 Nov 11, 2025
@github-actions
Copy link

Your PR couldn't be matched to an assignment in this module.

Please check its title is in the correct format, and that you only have one PR per assignment.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

@delmorallopez delmorallopez changed the title LONDON | 2025-NOV-SDC | Sprint1 London | 25-SDC-Nov | Jesus del Moral | Sprint 1| Individual Shell Tools Nov 11, 2025
@delmorallopez delmorallopez added the 📅 Sprint 1 Assigned during Sprint 1 of this module label Nov 17, 2025
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start on this sprint's tasks, I have spotted a few areas where you could improve code further

# I was tempted to take a bite of it.
# But this seemed like a bad idea...

cat ../helper-files/helper-1.txt ../helper-files/helper-2.txt ../helper-files/helper-3.txt

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way of doing the same without manually listing every file?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function has been modified




nl -b a ../helper-files/helper-1.txt ../helper-files/helper-2.txt ../helper-files/helper-3.txt

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment above about using a wildcard instead of listing each file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function has been modified

# TODO: Write a command to output the number of lines in dialogue.txt that contain the word Doctor (regardless of case).
# The output should be exactly the number 9.

grep -n "Doctor" dialogue.txt -i | wc -l

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an option you can use instead of piping to wc?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function has been modified

# The output should show that dialogue.txt contains 6 lines, dialogue-2.txt contains 2, and dialogue-3.txt contains 0.

for f in *.txt; do
echo "$f: $(grep -i "^Doctor:" "$f" | wc -l)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an interesting approach. It should be possible to complete with a single grep command, though. Can you figure out how?

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 19, 2025
@delmorallopez delmorallopez added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 26, 2025
@LonMcGregor
Copy link

Great, this looks finished now

@LonMcGregor LonMcGregor added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. 📅 Sprint 1 Assigned during Sprint 1 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants